Repository navigation
Docs: Port effective KRM function guide from #3367 - #4873
Merged
Merged
Conversation
Port the effective Go KRM function guide from kptdev#3367 to the current documentation tree. Rewrites examples against the current krm-functions-sdk API (Run with results and bool return, functionConfig accessors, nested getters returning value, found, err). Assisted-by: Kiro:claude-haiku-5.5 Signed-off-by: liamfallon <liam.fallon@est.tech>
Signed-off-by: liamfallon <liam.fallon@est.tech>
Add the minimum Go version, note that items are modified in place, add fn.IsName, and explain that As decodes a copy of the sub-object. Assisted-by: Kiro:claude-haiku-5.5 Signed-off-by: liamfallon <liam.fallon@est.tech>
liamfallon
requested review from
efiacor,
kispaljr and
mozesl-nokia
as code owners
November 13, 2026 11:28
✅ Deploy Preview for kptdocs ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify project configuration. |
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The guide uses SDK APIs that no longer compile and incorrectly implies that filtering a Runner’s local items changes output membership.
2 open issues
What changed in this PR
Ports the effective KRM function guide from #3367 into the current Hugo documentation, adding practical resource-editing patterns alongside the existing developer tutorials.
Changes:
- Adds examples for reading configuration, selecting resources, updating fields, and decoding sub-objects.
- Links the guide from the developer guide index and the developing-functions book chapter.
| File | Description |
|---|---|
documentation/content/en/guides/krm-functions/effective.md |
Adds the practical KRM function guide. |
documentation/content/en/guides/krm-functions/_index.md |
Adds the guide to the developer guide index. |
documentation/content/en/book/05-developing-functions/_index.md |
Links to the guide from Next Steps. |
Review effort: Balanced
Signed-off-by: liamfallon <liam.fallon@est.tech>
Signed-off-by: liamfallon <liam.fallon@est.tech>
CsatariGergely
approved these changes
Nov 13, 2026
aravindtga
approved these changes
Nov 13, 2026
Catalin-Stratulat-Ericsson
approved these changes
Nov 13, 2026
efiacor
approved these changes
Nov 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Docs: Port effective KRM function guide from #3367
Description
documentation/content/en/guides/krm-functions/effective.md, titled "Effective KRM functions". It covers reading function configuration, selecting resources withWhere/WhereNot, reading and updating fields, working with sub-objects, and decoding into typed structs. The guide is linked from the KRM Function Developer Guide index and from the Next Steps of the Go book chapter (book/05-developing-functions).site/tree. That tree has since been replaced by the Hugo site underdocumentation/, so the PR can't be rebased. The content is ported here onto the current docs structure. Thanks to @droot and @justinsb for the review comments on [WIP] Function SDK guide #3367, which shaped this version.krm-functions-sdkAPI. The originalRunsignature,*OrDiehelpers andfn.IsGVKcalls were replaced because they no longer exist or are deprecated.Review comments on #3367 and how they are addressed
kpt pkg getare confusing for Go developers. The port has no setup section. Project setup belongs to the Tutorial.get-started-runnerURL. The port uses the current SDK location and no longer references that path.itemsis modified in place. Added to the Select section.IsGKrather thanIsGVKwith an empty-value convention. The page usesfn.IsGroupVersionKindandfn.IsGroupKind, and notes thatIsGVKis deprecated.IsNameas a helper. Added to the Select section.Ascopies the sub-object, and changes must be made with the setters.Run, since readers would think they do something. The selection and update snippets are fragments, and the one completeRunshows the config-reading pattern.SetImagerather thanFunctionX, and show users passing the config as YAML rather than as a ResourceList. The page usesSetImageand shows the config as YAML.SomeBoolValue-style field names and theFnConfigprefix. These no longer apply, because config is read throughfunctionConfigrather than struct fields.Several code examples were also corrected against the current SDK during the port. They are documented in the commits on this branch.
Related Issue(s)
Type of Change
Checklist
Testing Instructions (Optional)
make servefromdocumentation/afternpm install. Check that the "Effective KRM functions" page renders under KRM Function Developer Guide and that its links resolve.book/05-developing-functions.krm-functions-sdkin a scratch module, outside this repo. Snippet compilation isn't part of the repo's test suite.Additional Notes (Optional)
TestingandContainerizingpages may benefit from matching examples, but that's out of scope here.documentation/content/en/guides/krm-functions/effective.md,krm-functions/_index.mdandbook/05-developing-functions/_index.md.AI Disclosure
If so, please describe how:
Assisted-bytrailer.